#include						<iostream>
#include						"ASocket.h"

void							ASocket::setHandler(PacketHandler *handler)
{
	_handler = handler;
}

unsigned int					ASocket::getId() const
{
	return _id;
}

ASocket::eSocketType			ASocket::getSocketType() const
{
	return _type;
}

void							ASocket::_getOrderSize()
{
	byte						size[2];

	size[0] = _buffer.read();
	size[1] = _buffer.read();
	_current_msg = *((unsigned short*)size);
	if (_current_msg > 4096)
		std::cout << "[CRITICAL] Corrupted packed received" << std::endl;
}